//    https://www.nowcoder.com/questionTerminal/9fbb4d95e6164cd9ab52e859fbe8f4ec



#include <iostream>
#include <string>
#include <map>
#include <algorithm>

using namespace std;

int main()
{
    int N;
    cin >> N;
    map<string, int> ss;
    for (int i = 0; i < N; i++)
    {
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        ss[s]++;
    }
    cout << ss.size() << endl;
    return 0;
}